//index.js
//获取应用实例
var app = getApp()
Page({
  data: {
    list: [],
    imgUrls: [],
    indicatorDots: true,
    autoplay: true,
    interval: 3000,
    duration: 1000
  },
  onLoad: function () {
    var that = this;
    console.log('欢迎加入微信小程序开发QQ群:171477235')
    wx.request({
      url: 'http://news.at.zhihu.com/api/4/news/latest',
      data: {},
      header: {
          'Content-Type': 'application/json'
      },
      success: function(res) {
        //console.log(res.data)
        //top_stories stories
        //console.log(res.data.top_stories);
        //console.log(res.data.stories);
        var top_stories = res.data.top_stories;
        that.setData({
          imgUrls: res.data.top_stories,
          list: res.data.stories
        })
      }
    })
  }
})
